<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>管理系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
</head>
<!-- 引入 Bootstrap -->

<link rel="stylesheet"
	href="${pageContext.request.contextPath}/style/css/amazeui.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/style/css/app.css">
<link
	href="${pageContext.request.contextPath}/style/css/bootstrap.min.css"
	rel="stylesheet" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/style/css/system.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/style/layui/css/layui.css" />
<link rel="shortcut icon"
	href="${pageContext.request.contextPath}/style/i/icon/warehouse.png"
	type="image/x-icon" />
<script src="${pageContext.request.contextPath}/style/js/jquery.min.js"></script>
<script
	src="${pageContext.request.contextPath}/style/js/jquery.cookie.js"></script>
<script
	src="${pageContext.request.contextPath}/style/js/jquery.base64.js"></script>
<!-- 包括所有已编译的插件 -->
<script
	src="${pageContext.request.contextPath}/style/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/style/js/amazeui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/style/layui/layui.js"></script>
<body>
	<div class="top_div">
		<div class="top_div_item_container">
			<a href="${pageContext.request.contextPath}/view/login/welcom.jsp"
				target="content"> <i style="color:#F8F8FF;font-size:18px"
				class="glyphicon glyphicon-leaf"></i> <small class="top_div_item">后台管理系统</small></a>
		</div>

		<div class="top_div_icon btn-group" style="z-index:2">
			<button class="btn btn-primary dropdown-toggle"
				data-toggle="dropdown"
				style="height:100%;width:100%;background-color: #93cbf9;">
				<span class="glyphicon glyphicon-user "
					style="color:#F8F8FF;font-size:20px"></span> <small
					style="color:#F8F8FF">Welcom,</small><font>${user.userName}</font>
				<span class="caret"></span>
			</button>
			<ul class="dropdown-menu" role="menu">
				<li><i style="position: relative;top: 17px;left:5px;"
					class="am-icon-key"></i><a
					href="javascript:void(0)"
					onclick="loginout()">修改密码</a></li>
				<li class="divider"></li>
				<li><i style="position: relative;top: 17px;left:5px;"
					class="am-icon-power-off"></i><a
					href="${pageContext.request.contextPath}/user/loginout" >退出登陆 </a></li>
			</ul>

		</div>

	</div>
	<div style="height:50px;">
		<nav class="navbar navbar-default top_div_2" role="navigation">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target="#example-navbar-collapse">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
			</div>
			<div class="collapse navbar-collapse" id="menu"></div>
		</div>
		</nav>
	</div>

	<div id="main" style="height:80%;width:100%">
		<iframe src="${pageContext.request.contextPath}/view/login/welcom.jsp"
			name="content" style="height:100%;width:100%"></iframe>
	</div>
	<div></div>

</body>

<script type="text/javascript">
	$(document).ready(function() {
		$("#menu").html("");
		var s="<ul class='nav navbar-nav'><li><a href='${pageContext.request.contextPath}/view/login/welcom.jsp' target='content'>首页</a></li>";
		<c:forEach items="${menulist}" var="list">
			s+="<li class='dropdown'><a href='${list.menuUrl}' class='dropdown-toggle' data-toggle='dropdown'> ${list.menuName}<b class='caret'></b></a><ul class='dropdown-menu'>";
			<c:forEach items="${list.second}" var="second">
			s+="<li><a href='${pageContext.request.contextPath}${second.menuUrl}' target='content'>${second.menuName}</a></li>";
			
			</c:forEach>
			s+="</ul></li>";
		</c:forEach>
		$("#menu").html(s);
		
	});
	
	function loginout(){
		layui.use('layer', function() {
			var layer = layui.layer; 
				layer.open({
					type : 2,
					title : '修改密码',
					content : [ '${pageContext.request.contextPath}/user/changepassword', 'no' ],
					area : [ '500px', '300px' ],
					offset: ['100px', '350px']

				});
			});
	}
</script>
</html>
